package ma.mindware.mpm.domain.tutorial;

import java.util.ArrayList;
import java.util.Properties;

import ma.mindware.met.core.technicalservice.ServiceRunner;
import ma.mindware.met.core.technicalservice.TechnicalServiceException;
import ma.mindware.mpm.domain.tutorial.Quote;
import ma.mindware.mpm.technicalservice.db.QuoteDBService;
import ma.mindware.mpm.util.Connecter;

import com.opensymphony.xwork2.ActionSupport;

public class QuoteController extends ActionSupport {
	
	private Quote quoteInstance ;
	private ArrayList<Quote> quoteList; 
	private int pages ;
	private ArrayList<Integer> beginPage ;
	private ArrayList<Boolean> checkedQuotes ;
	private boolean checkedQuote ;
	

	private Connecter connecter ;
	
	public QuoteController() {

		connecter = new Connecter();
	}
	
	

	public String listQuote(){
		connecter.getDBServiceRunner();
		
		try {
			quoteList=(ArrayList<Quote>)connecter.getServiceRunner().run(QuoteDBService.class, connecter.getServiceParameters() , "getQuoteList");
			
		} catch (TechnicalServiceException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return SUCCESS;
	}

	public Quote getQuoteInstance() {
		return quoteInstance;
	}

	public void setQuoteInstance(Quote quoteInstance) {
		this.quoteInstance = quoteInstance;
	}

	public ArrayList<Quote> getQuoteList() {
		return quoteList;
	}

	public void setQuoteList(ArrayList<Quote> quoteList) {
		this.quoteList = quoteList;
	}

	public boolean isCheckedQuote() {
		return checkedQuote;
	}

	public void setCheckedQuote(boolean checkedQuote) {
		this.checkedQuote = checkedQuote;
	}

	
	public ArrayList<Boolean> getCheckedQuotes() {
		return checkedQuotes;
	}

	public void setCheckedQuotes(ArrayList<Boolean> checkedQuotes) {
		this.checkedQuotes = checkedQuotes;
	}
	
	
}
